#ifndef __SOFTBUS_DEVICE_REPORT_H__
#define __SOFTBUS_DEVICE_REPORT_H__

#include <stdbool.h>

const int32_t BUNDLE_NAME_SIZE = 64;
const int32_t SN_SIZE = 65;
const int32_t NETWORK_ID_SIZE = 65;
const int32_t DATA_SIZE = 512;
#pragma pack(1)
typedef struct
{
    char bundleName[BUNDLE_NAME_SIZE];
    char SN[SN_SIZE];
    char networkId[NETWORK_ID_SIZE];
    int32_t type;
    int32_t port;
    int32_t portOffset;
    char data[DATA_SIZE];
} SendPortMsgInfo;
#pragma pack()

typedef struct {
    void (*OnBytesReceived)(int sessionId, const void *data, unsigned int dataLen);
    void (*OnMessageReceived)(int sessionId, const void *data, unsigned int dataLen);
} IKHSessionCallback;

int StartSoftbusDeviceReportTask(void);
void StopSoftbusDeviceReportTask(void);
bool IsSoftbusDeviceAvailable(void);
int SendDataToRouter(const char *bundleName, const char *SN, int type, int port, int portOffset, const void *data, unsigned int dataLen);
void RegisterSessionCallback(IKHSessionCallback *callback);

#endif

MAIN(){
    AUOT ADAPTOR = new IoDevicefactory(常量_设备类型)
    ADAPTOR::INITDEVICE()
    //组装回调
    regiterSessionCallback(&callback)


    ()=>{
        return {
            onNodeOnline: (nodeinfo)=>{
               nodeinfo.networkId

                //订阅添加

            },
        }
    }
    


while(1){
    //检查设备功能
    //检查是否有订阅
    continue;
    //检测是否有l2在线
    osdelay(1000)//可配置

    //发送或者读取1数据
    SendDataToHost(sessionId,data,len)
  
}
    L2
    ADAPTOR:input()
    output()
}